package lab02.test27;

import java.util.InputMismatchException;
import java.util.Scanner;

public class Test {
    public static void main(String[] args) {


        int a = 0;
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一个整数:");

        try {
            a = scanner.nextInt();
        } catch (InputMismatchException e) {
            System.out.println("输入的数不是整数!");
        }finally {
            System.out.println("a=" + a);
        }
        }
}
